/*
 * @Author: 迷洛洛ywc
 * @Date: 2024-05-30 14:44:56
 * @LastEditors: 迷洛洛ywc
 * @LastEditTime: 2024-06-24 09:20:42
 * @Description: file content
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'vant/lib/index.css'
import echarts from 'echarts'
import './css/vant.css'

import { Divider, Sticky, Form, Field, Button, List, Icon, Toast, Tabs, Tab, ImagePreview, Loading, Dialog, Cell, CellGroup, Uploader, Popup, Picker, ActionSheet, Search } from 'vant'
Vue.use(Divider)
Vue.use(Dialog)
Vue.use(Sticky)
Vue.use(Form)
Vue.use(Field)
Vue.use(Button)
Vue.use(List)
Vue.use(Icon)
Vue.use(Toast)
Vue.use(Tabs)
Vue.use(Tab)
Vue.use(ImagePreview)
Vue.use(Loading)
Vue.use(Cell)
Vue.use(Uploader)
Vue.use(CellGroup)
Vue.use(Popup)
Vue.use(Picker)
Vue.use(ActionSheet)
Vue.use(Search)

Vue.config.productionTip = false
Vue.prototype.$echarts = echarts

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
router.beforeEach((to, from, next) => {
  console.log(to, 'to')
  console.log(from, 'from')

  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
